package com.hxk.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
	
	@Value("${msg}")//从application.properties文件中获取自定义配置内容
	private String msg;

	@RequestMapping("/hello")
	@ResponseBody
	public Map<String, Object> showHello(){
		Map<String, Object> rsMap = new HashMap<>();
		rsMap.put("msg", this.msg);
		return rsMap;
	}
}
